package test.sunyu.kit.hbase.comparator;

import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.io.WritableComparator;

/**
 * 用于Reduce排序
 *
 * @author 孙宇
 */
public class RowKeyRawComparator extends WritableComparator {
    protected RowKeyRawComparator() {
        super(Text.class, true);
    }

    @Override
    public int compare(WritableComparable a, WritableComparable b) {
        //return super.compare(a, b);//正序
        return -super.compare(a, b);//倒序
    }
}
